package com.arouter;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.alibaba.android.arouter.launcher.ARouter;

@Route(path = "/com/MainActivity")
public class MainActivity extends AppCompatActivity {
    private TextView textView;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        ARouter.getInstance().inject(this);
        initView();

    }

    public void initView() {
        textView = findViewById(R.id.next);
        final Person person = new Person("小明", "20");


        textView.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                 TestObj testObj = new TestObj("Rose", 777);

                ARouter.getInstance().build("/com/TestActivity").withString("name", "张三")
                        .withString("testObj", "哈哈哈")
                        .withString("person", "小缸").navigation();
            }
        });
    }
}
